
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title></title>
   <link rel="stylesheet" type="text/css" href="<g:createLinkTo dir="css" file="main.css"/>">
    <link rel="stylesheet" type="text/css" href="../css/errors.css">
    <link rel="stylesheet" type="text/css" href="../css/mobile.css">
    <script src="../js/jquery-2.1.0.js"></script>
    <script src="../js/application.js"></script>
</head>
</head>

<body>
<%int count = 1;%>
%{--border="1" style="border-collapse: collapse;--}%

<table id="show">
    <tr>

        <td>Number</td>
        <td>Name</td>

        <td class="ageColumn">Age</td>
        <td>Data</td>
        <td>City</td>
        <td>Street</td>
        <td>Home</td>
    </tr>
    <g:each in="${persons}" var="person">
        <tr id="table${person?.id}" onclick="select('${person.id}')">
            %{--<td ><%=count++%></td>--}%
            %{--<td>${person.id}</td>--}%

            <td><%=++offset%></td>
            <td>${person?.name}</td>
            <td class="ageColumn">${person?.age}</td>
            <td><g:formatDate format="dd-MM-yyyy" date="${person?.date}"/> </td>

            <td>${person?.address?.city}</td>
            <td>${person?.address?.street}</td>
            <td>${person?.address?.number}</td>

        </tr>
    </g:each>

</table>
<div id="pages">
<g:paginate total="${personCount}" max="5" next="Next" prev="Prev" action="createPerson"/>
</div>
</body>
</html>